package com.yuanchu.store.controller;

import com.yuanchu.common.utils.R;
import com.yuanchu.store.service.YoshopStoreSettingService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @version: 1.0
 * @Author: adan
 * @description:
 * @date: 2024-01-27 21:30
 */
@RestController
@RequestMapping("setting")
public class ShopSettingController {

    @Resource
    private YoshopStoreSettingService storeSettingService;

    Integer storeId = 10001;

    @GetMapping("data")
    public R queryData() {
        Map<String, Object> map = storeSettingService.queryData();
        Map<String, Object> data = new HashMap<>();
        data.put("setting", map);
        return R.ok().put("data", data);
    }

    @ApiOperation("积分设置接口")
    @GetMapping("/point")
    public String queryPointData() {
         return storeSettingService.queryPointData().getValues();
    }

    // @ApiOperation("查新物流接口")
    // @GetMapping("/express/all")
    // public R queryExpressAll() {
    //     List<YoshopExpressEntity> entities = storeSettingService.queryExpressAll(storeId);
    //     Map<String, Object> data = new HashMap<>();
    //     data.put("list", entities);
    //     return R.ok().put("data",data );
    // }

}
